package cn.itcast.order.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

//接口必须加这个注解
@LocalTCC
public interface OrderTCCService {
    //此注解的方法表示为Try
    @TwoPhaseBusinessAction(name = "TestTry",commitMethod = "TestConfirm",rollbackMethod = "TestRollBack")
    void TestTry(@BusinessActionContextParameter(paramName = "orderId") int orderId,
                 @BusinessActionContextParameter(paramName = "freezeNum") int freezeNum);

    boolean TestConfirm(BusinessActionContext context);

    boolean TestRollBack(BusinessActionContext context);
}
